import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Layout from '@/layout'
// 定义路由
const routes = [
	{
		path: '/',
		component: Layout,
		redirect: '/Home',
		children: [
			{
				path: '/Home',
				name: 'Home',
				component: () => import('@/pages/Home.vue')
			},
			{
				path: '/Home1',
				name: 'Home1',
				component: () => import('@/pages/Home1.vue')
			}
		]

	}
];

const createRouter = () => new VueRouter({
	// mode: 'history', //  使用 history 模式 需要后台配置支持
	routes,
	scrollBehavior: () => ({ y: 0 })
})
const router = createRouter()

export default router;
